import request from '../../utils/request'

/**
 * 新增码头
 *
 * @param wharfForm
 * @param bindingResult
 * @return
 */
export async function addWharf(wharfForm) {
    return request(apiPath.mc + "/api/wharf", {
        method: 'post',
        data: { ...wharfForm }
    });
}


/**
 * 更新码头
 *
 * @param wharfForm
 * @param bindingResult
 * @return
 */
export async function updateWharf(wharfForm) {
    return request(apiPath.mc + "/api/wharf", {
        method: 'put',
        data: { ...wharfForm }
    });
}


/**
 * 根据id删除码头
 *
 * @param id
 * @return
 */
export async function deleteWharfById({ id }) {
    return request(apiPath.mc + "/api/wharf/" + id, {
        method: 'delete'
    });
}


/**
 * 根据id获取码头
 *
 * @param id
 * @return
 */
export async function getWharfById({ id }) {
    return request(apiPath.mc + "/api/wharf/" + id, {
        method: 'get'
    });
}


/**
 * 分页查询码头
 * 
 * @param wharf
 * @param port
 * @param page
 */
export async function getListForPage({ wharf, port, lesseeCode, page }) {
    return request(apiPath.mc + "/api/wharf", {
        method: 'get',
        data: { wharf, port, lesseeCode, page: page.page, size: page.size }
    });
}


/**
 * 查询租户下所有未删除的码头
 * 
 */
export async function getAllWharfs() {
    return request(apiPath.mc + "/api/wharf/all", {
        method: 'get'
    });
}